home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / emcs1857 / 1857sr~1.zoo / lisp / iso-chars.el < prev    next >
Encoding:
Text File  |  1992-01-24  |  6.0 KB  |  141 lines

  1. ;;;;  iso-chars.el
  2. ;;;;
  3. ;;;;  Define char tables for displaying the eight bit ISO fonts.
  4. ;;;;
  5. ;;;;  Author:    Thomas Bellman
  6. ;;;;        Lysator Computer Club
  7. ;;;;        Linkoping University
  8. ;;;;        Sweden
  9. ;;;;
  10. ;;;;  email:    Bellman@Lysator.LiU.Se
  11.  
  12.  
  13. (require 'char-table)
  14.  
  15. (defvar iso8859-char-table nil
  16.   "Char table for showing ISO 8859 characters on ISO 8859 terminals.
  17. This displays the control characters in the range [0,31] as ^X, control
  18. characters in the range [128,159] as \\nnn, the DEL character as ^? and
  19. all other characters are displayed directly.")
  20.  
  21. (defvar iso8859-1-ascii-char-table nil
  22.   "Char table for showing ISO 8859-1 characters on ASCII terminals.")
  23.  
  24. (defvar iso8859-1-ascii-oneglyf-char-table nil
  25.   "Char table for showing ISO 8859-1 characters on ASCII terminals, using
  26. one glyf per character.")
  27.  
  28. (defvar iso8859-1-swascii-char-table nil
  29.   "Char table for showing ISO 8859-1 characters on \"swascii\" terminals,
  30. i e terminals using the Swedish variant of ISO 646.")
  31.  
  32. (defvar iso8859-1-swascii-oneglyf-char-table nil
  33.   "Char table for showing ISO 8859-1 characters on \"swascii\" terminals,
  34. using one glyf per character.")
  35.  
  36.  
  37.  
  38. (setq iso8859-char-table (copy-char-table default-buffer-char-table))
  39. (let ((ch 0))
  40.   (while (<= ch 31)
  41.     (if (not (or (= ch 9) (= ch 10)))
  42.     (put-char-table-dispr iso8859-char-table ch
  43.                   (string-to-rope (format "^%c" (+ ch 64)))))
  44.     (setq ch (1+ ch)))
  45.   (while (<= ch 126)
  46.     (put-char-table-dispr iso8859-char-table ch
  47.               (string-to-rope (char-to-string ch)))
  48.     (setq ch (1+ ch)))
  49.   (put-char-table-dispr iso8859-char-table 127 (string-to-rope "^?"))
  50.   (setq ch 128)
  51.   (while (<= ch 159)
  52.     (put-char-table-dispr iso8859-char-table ch
  53.               (string-to-rope (format "\\%3o" ch)))
  54.     (setq ch (1+ ch)))
  55.   (while (<= ch 255)
  56.     (put-char-table-dispr iso8859-char-table ch
  57.               (string-to-rope (char-to-string ch)))
  58.     (setq ch (1+ ch))))
  59.  
  60.  
  61.  
  62. (setq iso8859-1-ascii-char-table (copy-char-table iso8859-char-table))
  63. (mapcar '(lambda (pair)
  64.        (put-char-table-dispr iso8859-1-ascii-char-table (car pair)
  65.                  (string-to-rope (car (cdr pair)))))
  66.     '((?\240 " ")     (?\241 "!")     (?\242 "c")     (?\243 "GBP")
  67.       (?\244 "$")     (?\245 "JPY")   (?\246 "|")     (?\247 "$)")
  68.       (?\250 "\"")    (?\251 "(c)")   (?\252 "_a")    (?\253 "<<")
  69.       (?\254 "!")     (?\255 "-")     (?\256 "(R)")   (?\257 "=")
  70.       (?\260 "^o")    (?\261 "+-")    (?\262 "^2")    (?\263 "^3")
  71.       (?\264 "'")     (?\265 "u")     (?\266 "$)")    (?\267 "*")
  72.       (?\270 ",")     (?\271 "^1")    (?\272 "_o")    (?\273 ">>")
  73.       (?\274 " 1/4")  (?\275 " 1/2")  (?\276 " 3/4")  (?\277 "?")
  74.       (?\300 "A`")    (?\301 "A'")    (?\302 "A^")    (?\303 "A~")
  75.       (?\304 "A\"")   (?\305 "AA")    (?\306 "AE")    (?\307 "C,")
  76.       (?\310 "E`")    (?\311 "E'")    (?\312 "E^")    (?\313 "E\"")
  77.       (?\314 "I`")    (?\315 "I'")    (?\316 "I^")    (?\317 "I\"")
  78.       (?\320 "D-")    (?\321 "N~")    (?\322 "O`")    (?\323 "O'")
  79.       (?\324 "O^")    (?\325 "O~")    (?\326 "O\"")   (?\327 "*")
  80.       (?\330 "O/")    (?\331 "U`")    (?\332 "U'")    (?\333 "U^")
  81.       (?\334 "U\"")   (?\335 "Y'")    (?\336 "Th")    (?\337 "ss")
  82.       (?\340 "a`")    (?\341 "a'")    (?\342 "a^")    (?\343 "a~")
  83.       (?\344 "a\"")   (?\345 "aa")    (?\346 "ae")    (?\347 "c,")
  84.       (?\350 "e`")    (?\351 "e'")    (?\352 "e^")    (?\353 "e\"")
  85.       (?\354 "i`")    (?\355 "i'")    (?\356 "i^")    (?\357 "i\"")
  86.       (?\360 "d-")    (?\361 "n~")    (?\362 "o`")    (?\363 "o'")
  87.       (?\364 "o^")    (?\365 "o~")    (?\366 "o\"")   (?\367 "-:")
  88.       (?\370 "o/")    (?\371 "u`")    (?\372 "u'")    (?\373 "u^")
  89.       (?\374 "u\"")   (?\375 "y'")    (?\376 "th")    (?\377 "y\"")))
  90.  
  91.  
  92.  
  93. (setq iso8859-1-ascii-oneglyf-char-table (copy-char-table iso8859-char-table))
  94. (mapcar '(lambda (pair)
  95.        (put-char-table-dispr iso8859-1-ascii-oneglyf-char-table
  96.                  (car pair) (string-to-rope (car (cdr pair)))))
  97.     '((?\240 " ")     (?\241 "!")     (?\242 "c")     (?\243 "#")
  98.       (?\244 "$")     (?\245 "Y")     (?\246 "|")     (?\247 "$")
  99.       (?\250 "\"")    (?\251 "c")     (?\252 "+")     (?\253 "?")
  100.       (?\254 "!")     (?\255 "-")     (?\256 "R")     (?\257 "~")
  101.       (?\260 "C")     (?\261 "+")     (?\262 "2")     (?\263 "3")
  102.       (?\264 "'")     (?\265 "u")     (?\266 "$")     (?\267 "-")
  103.       (?\270 ",")     (?\271 "1")     (?\272 "0")     (?\273 "?")
  104.       (?\274 "?")     (?\275 "?")     (?\276 "?")     (?\277 "?")
  105.       (?\300 "A")     (?\301 "A")     (?\302 "A")     (?\303 "A")
  106.       (?\304 "A")     (?\305 "A")     (?\306 "A")     (?\307 "C")
  107.       (?\310 "E")     (?\311 "E")     (?\312 "E")     (?\313 "E")
  108.       (?\314 "I")     (?\315 "I")     (?\316 "I")     (?\317 "I")
  109.       (?\320 "D")     (?\321 "N")     (?\322 "O")     (?\323 "O")
  110.       (?\324 "O")     (?\325 "O")     (?\326 "O")     (?\327 "*")
  111.       (?\330 "O")     (?\331 "U")     (?\332 "U")     (?\333 "U")
  112.       (?\334 "U")     (?\335 "Y")     (?\336 "T")     (?\337 "B")
  113.       (?\340 "a")     (?\341 "a")     (?\342 "a")     (?\343 "a")
  114.       (?\344 "a")     (?\345 "a")     (?\346 "a")     (?\347 "c")
  115.       (?\350 "e")     (?\351 "e")     (?\352 "e")     (?\353 "e")
  116.       (?\354 "i")     (?\355 "i")     (?\356 "i")     (?\357 "i")
  117.       (?\360 "d")     (?\361 "n")     (?\362 "o")     (?\363 "o")
  118.       (?\364 "o")     (?\365 "o")     (?\366 "o")     (?\367 "/")
  119.       (?\370 "o")     (?\371 "u")     (?\372 "u")     (?\373 "u")
  120.       (?\374 "u")     (?\375 "y")     (?\376 "t")     (?\377 "y")))
  121.  
  122.  
  123. (setq iso8859-1-swascii-char-table
  124.       (copy-char-table iso8859-1-ascii-char-table))
  125. (mapcar '(lambda (pair)
  126.        (put-char-table-dispr iso8859-1-swascii-char-table
  127.                  (car pair) (string-to-rope (car (cdr pair)))))
  128.     '((?\304 "[")     (?\305 "]")     (?\311 "@")     (?\326 "\\")
  129.       (?\334 "^")     (?\344 "{")     (?\345 "}")     (?\351 "`")
  130.       (?\366 "|")     (?\374 "~")))
  131.  
  132.  
  133. (setq iso8859-1-swascii-oneglyf-char-table
  134.       (copy-char-table iso8859-1-ascii-oneglyf-char-table))
  135. (mapcar '(lambda (pair)
  136.        (put-char-table-dispr iso8859-1-swascii-oneglyf-char-table
  137.                  (car pair) (string-to-rope (car (cdr pair)))))
  138.     '((?\304 "[")     (?\305 "]")     (?\311 "@")     (?\326 "\\")
  139.       (?\334 "^")     (?\344 "{")     (?\345 "}")     (?\351 "`")
  140.       (?\366 "|")     (?\374 "~")))
  141.